package com.bto.solar.work.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.*;
import java.util.List;

@Data
@NoArgsConstructor
public class RegisterUserReq {

    @NotBlank(message = "用户名不能为空")
    @ApiModelProperty("用户名")
    private String name;

    @NotBlank(message = "账号不能为空")
    @ApiModelProperty("账号")
    private String account;

    @ApiModelProperty("邮箱")
    private String email;

    @Min(value = 0, message = "性别是男，女，未知")
    @Max(value = 2, message = "性别是男，女，未知")
    @ApiModelProperty("性别")
    private Byte gender;

    @NotNull(message = "[公司ID]不能为空")
    @ApiModelProperty("公司ID")
    private Long companyId;

    @NotNull(message = "[可创建业务]不能为空")
    @ApiModelProperty("权限")
    private List<String> permissionList;

    @NotBlank(message = "[用户手机号]不能为空")
    @Pattern(regexp = "^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\\d{8}$",message = "手机号格式异常")
    @ApiModelProperty("电话")
    private String phone;

    @NotBlank(message = "[密码]不能为空")
    @ApiModelProperty("密码")
    private String password;
}
